﻿using System;
using System.Collections.Generic;
using AgileBoard.Domain;

namespace AgileBoard.Demo
{
    public class FakeReleaseData
    {
        public static List<Release> CreateTestReleases()
        {
            var releases = new List<Release>
                               {
                                   SellableVersion()
                                   //AdsupportedVersion()
                               };

            for (int i = 0; i < 10; i++)
            {
                var sampleRelease = new Release
                                        {
                                            ReleaseID = Guid.NewGuid(),
                                            //ProjectID = new Guid("2EBDBC36-3585-47b3-8709-BE3184956938"),
                                            Name = "New Release",
                                            PeriodFrom = DateTime.Now,
                                            PeriodTo = DateTime.Now.AddDays(27),
                                            CreateTime = DateTime.Now
                                        };

                //sampleRelease.AddIteration(FakeIterationData.CreateTestIterations()[i]);
                //sampleRelease.AddFeature(FakeFeatureData.CreateTestFeatures()[i]);

                //releases.Add(sampleRelease);
            }

            return releases;
        }

        public static Release DemoRelease()
        {
            var demo = new Release
                           {
                               ReleaseID = new Guid("29DC7A46-52B5-4941-AAE2-F48592847E42"),
                               ProjectID = new Guid("29DC7A46-52B5-4941-AAE2-F48592847E42"),
                               Name = "New Release",
                               PeriodFrom = DateTime.Now,
                               PeriodTo = DateTime.Now.AddDays(27),
                               CreateTime = DateTime.Now
                           };

            demo.AddFeature(FakeFeatureData.DemoFeature());
            demo.AddIteration(FakeIterationData.DemoIteration());

            return demo;
        }

        public static Release SellableVersion()
        {
            var demo = new Release
                           {
                               ReleaseID = new Guid("3DFC646E-D49B-4c8c-84F0-B1FAFC105E47"),
                               ProjectID = new Guid("29DC7A46-52B5-4941-AAE2-F48592847E42"),
                               Name = "Sellable version",
                               PeriodFrom = DateTime.Now.RemoveDays(17),
                               PeriodTo = DateTime.Now.AddDays(9),
                               CreateTime = DateTime.Now
                           };

            demo.AddFeature(FakeFeatureData.DemoFeature1());
            demo.AddFeature(FakeFeatureData.DemoFeature2());
            demo.AddFeature(FakeFeatureData.DemoFeature3());
            demo.AddIteration(FakeIterationData.Sprint1());
            demo.AddIteration(FakeIterationData.Sprint2());

            return demo;
        }


        public static Release AdsupportedVersion()
        {
            var demo = new Release
                           {
                               ReleaseID = new Guid("1A8ACB7C-CF3C-4977-81A1-8CCFBFD352FA"),
                               ProjectID = new Guid("29DC7A46-52B5-4941-AAE2-F48592847E42"),
                               Name = "Ad-supported version",
                               PeriodFrom = DateTime.Now.AddDays(10),
                               PeriodTo = DateTime.Now.AddDays(16),
                               CreateTime = DateTime.Now
                           };

            demo.AddFeature(FakeFeatureData.DemoFeature4());
            demo.AddIteration(FakeIterationData.Sprint3());

            return demo;
        }

        public static Release DefaultRelease()
        {
            var Default = new Release
                              {
                                  ReleaseID = new Guid("BE4B0656-8685-439e-B4EA-66D5C9BA7508"),
                                  ProjectID = new Guid("BE4B0656-8685-439e-B4EA-66D5C9BA7508"),
                                  Name = "New Release",
                                  PeriodFrom = DateTime.Now,
                                  PeriodTo = DateTime.Now.AddDays(27),
                                  CreateTime = DateTime.Now
                              };

            Default.AddFeature(FakeFeatureData.DefaultFeature());
            Default.AddIteration(FakeIterationData.DefaultIteration());

            return Default;
        }
    }
}